<?php

namespace App\Entities;

use Illuminate\Database\Eloquent\Model;

class ConvertibleCardUseRecordModel extends Model
{
    public const TYPE_BUY = 1;  // 购买权限卡次数
    public const TYPE_USE = 2;  // 使用
    public const TYPE_REFUND = 3;  // 退会

    protected $table = 'convertible_card_use_record';

    public static function getUserCardRecordData(int $userCardId)
    {
        $where = [
            'user_card_id' => $userCardId,
        ];
        $dataList = self::where($where)->get();
        return $dataList;
    }
}
